import request from '@/utils/request'

// 查询用户列表
export function listProject(query) {
  return request({
    url: '/gen/project/page',
    method: 'get',
    params: query
  })
}

export function list() {
  return request({
    url: '/gen/project/list',
    method: 'get',
  })
}

export function useProjectApi(id) {
  return request({
    url: '/gen/project/' + id,
    method: 'get'
  })
}

export function useProjectSubmitApi(dataForm) {
  if (dataForm.id) {
    return request({
      url: '/gen/project',
      method: 'put',
      data: dataForm
    })
  } else {
    return request({
      url: '/gen/project',
      method: 'post',
      data: dataForm
    })
  }
}

// 源码下载
export function useSourceDownloadApi(id) {
  return request({
    url: '/gen/project/download/' + id,
    method: 'get',
  })
}

export const deleteProject = (ids) => {
  return request({url: '/gen/project', method: 'delete', data: ids})
}



